package com.qidian.by.goods.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @Author: CoolPro
 * @Description:
 * @Time: 2024-05-17 18:37
 **/
@Configuration
public class FanoutProperties {
    @Value("fanout-exchange")
    private String fanoutExchangeName = "fanout-exchange";
    @Value("item-queue")
    private String itemQueue = "item-queue";
    @Value("search-queue")
    private String searchQueue = "search-queue";
    @Value("item-message-confirm-tag")
    private String itemMessageConfirmTag = "ITEM_MESSAGE_CONFIRMED";
    @Value("item-message-fall-tag")
    private String itemMessageFallTag = "ITEM_MESSAGE_FAL";
    @Bean
    @Qualifier("fanoutExchangeProperty")
    public Properties fanoutExchangeProperty() {
        Properties property = new Properties();
        property.setProperty("fanout-exchange", fanoutExchangeName);
        property.setProperty("item-queue", itemQueue);
        property.setProperty("search-queue", searchQueue);
        property.setProperty("item-message-confirm-tag", itemMessageConfirmTag);
        property.setProperty("item-message-fall-tag", itemMessageFallTag);
        return property;
    }
}
